GPIOD user guide¶
Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.
Common commands for inspecting and controlling GPIO using gpiod tools on Quectel Pi. The currently connected development board has been verified with libgpiod v1.6.3.
Installation and Verification¶
sudo apt update
sudo apt install -y gpiod
gpiodetect --version
gpiodetect
gpioinfo
Command |
Purpose |
|---|---|
|
View GPIO controllers |
|
View GPIO line status and usage |
|
Read input state |
|
Set output state |
|
Monitor edge events |
Controller Identification¶
Example output from the current development board is shown below. For actual projects, refer to the output from the board in use.
gpiochip0 [400000.pinctrl] (114 lines)
gpiochip1 [1c40000.qcom,spmi:qcom,pm6125@0] (9 lines)
gpiochip2 [soc:spf_core_platform:lpi_pinct] (19 lines)
Common Commands¶
# View lines on the primary controller
gpioinfo /dev/gpiochip0
# Read line 36 of gpiochip0
gpioget gpiochip0 36
# Set output high and hold for 5 seconds
gpioset --mode=time --sec=5 gpiochip0 36=1
# Monitor rising-edge events
gpiomon --rising-edge gpiochip0 36
Version Differences¶
Function |
Current v1 Syntax |
Syntax That May Appear in Newer Documentation |
|---|---|---|
Read |
|
|
Hold Output |
|
|
Rising-edge Monitoring |
|
|
Notes¶
GPIO line offset is not the same as the physical header pin number.
Lines marked
[used]or already having a consumer should not be controlled directly.After the
gpiosetprocess exits, the output state may revert to the default. Do not rely on the residual level after the process exits.